// Copyright 叶湘 ( weixin:yexiang841, email:yexiang841@qq.com ), Shitouren Studio. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "Property/Q3D_CPPE_PropertyInit.h"
#include "Property/Q3D_CPPE_PropertyName.h"
#include "Q3D_CPPC_PropertyState.generated.h"

class UQ3D_CPPU_PropertyState;
class UQ3D_CPPU_Hit;

/**
 * 
 */
UCLASS(Blueprintable, ClassGroup = (Q3D), meta = (Tooltip = "PropertyState 管理器(C++)", BlueprintSpawnableComponent))
class Q3D_LIB_API UQ3D_CPPC_PropertyState : public UActorComponent
{
	GENERATED_BODY()

public:
	// Sets default values for this component's properties
	UQ3D_CPPC_PropertyState();

protected:
	// Called when the game starts
	virtual void BeginPlay() override;

public:
	// Called every frame
	virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override;

public:
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Q3D_PropertyState, meta = (Tooltip = "对 PropertyState 的引用"))
	UQ3D_CPPU_PropertyState *Ptr_U_PropertyState;

public:
	UFUNCTION(BlueprintCallable, Category = Q3D_PropertyState, meta = (Tooltip = "初始化"))
	void Q3D_F_Model_Init();

	UFUNCTION(BlueprintCallable, Category = Q3D_PropertyState, meta = (Tooltip = "根据传入的 DataTable 生成 PropertyPLIPro，存入 PropertyState"))
	void Q3D_F_Model_Set(UDataTable *ptr_dt_property_init);

	UFUNCTION(BlueprintCallable, Category = Q3D_PropertyState, meta = (Tooltip = "将某些 Max 属性的变化绑定到对应的 Now 属性的 Set_Max 函数"))
	void Q3D_F_Property_Bind_Max_To_Now(EQ3D_CPPE_PropertyName enum_property_name_max, EQ3D_CPPE_PropertyName enum_property_name_now);

	UFUNCTION(BlueprintCallable, Category = Q3D_PropertyState, meta = (Tooltip = "对某些 Now 属性施加自动恢复的命中，使用的 Value 是其对应的 Spd 属性"))
	void Q3D_F_Create_Hit_On_Now_By_Spd(EQ3D_CPPE_PropertyName enum_property_name_spd, EQ3D_CPPE_PropertyName enum_property_name_now, float float_hit_interval, UPARAM(DisplayName = "ptr_u_hit") UQ3D_CPPU_Hit *&ptr_u_hit);
};
